<script setup lang="ts">
import logoUrl from '@/assets/1.jpg'; // 使用 import 导入图片资源
import '@wangeditor/editor/dist/css/style.css';
import { useRouter } from 'vue-router';
const router = useRouter();

const goBack = () => {
  // 返回实训广场页面
  router.push({ path: '/user/practice' });
};
</script>

<template>
  <nav class="top-navbar">
    <div class="logo">
      <img :src="logoUrl" alt="logo">
    </div>
    <div class="title">
      <img src="@/assets/ProjectName.svg" alt="logo" class="h-8">
    </div>
    <div class="navigation">
      <button class="nav-button" @click="goBack">
        返回实训广场
      </button>
    </div>
  </nav>
</template>

<style scoped>
.top-navbar {
  display: flex;
  align-items: center;
  height: 3.75rem;
  padding: 0 1.25rem;
  background-color: #ffffff;
  box-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.1);
}

.logo img {
  height: 2.5rem;
  cursor: pointer;
}

.title {
  flex: 1;
  font-size: 1.5rem;
  font-weight: bold;
}

.navigation .nav-button {
  padding: 0.3125rem 0.9375rem;
  background-color: #007bff;
  color: #ffffff;
  border: none;
  border-radius: 0.3125rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.navigation .nav-button:hover {
  background-color: #0056b3;
}
</style>
